package com.lanyou.esb.cook.proxy.meta;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * BUNDLE模式<br>
 * 描述：<br>
 * 0：代理模式；1：自定义模式；
 * 
 * @author Davey.wu
 */
public enum BundleType {
	PROXY_MODE("0"), CUSTOM("1");

	public final String ValueCode;

	private BundleType(String code) {
		this.ValueCode = code;
	}

	public static BundleType get(String valueCode) throws NoSuchObjectException {
		if (StringUtils.isBlank(valueCode)) {
			throw new NullPointerException();
		}
		for (BundleType type : BundleType.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
